/************************************************************
 * Copyright (C), 2020-2030, Wondfo. Co., Ltd.
 * FileName:        global_ini.h
 * Author:			Dan Yin
 * Date:            2023-10-23
 * Description:		the global definition file for INI configure varibles
 * Version:			1.0.0.0
 **********************************************************/
#ifndef GLOBAL_INI_H
#define GLOBAL_INI_H

#include <QVariant>

#define DEF_IP_DOT_SPLIT_SIZE           4
#define DEF_MAC_DOT_SPLIT_SIZE          6


typedef struct ST_NET_LOCAL {
    QString     sIpAddr;
    QString     sMask;
    QString     sGetway;
    QString     sNetwork;
    QString     sMacAddr;

    ST_NET_LOCAL() {
        sIpAddr = "192.168.1.1";
        sMask = "255.255.255.0";
        sNetwork = "192.168.1.1";
        sGetway = "192.168.1.1";
        sMacAddr = "00:00:00:00:00:00";
    }
}NET_LOCAL;

enum EUM_NET_PROTOCAL {
    E_NET_TCP, E_NET_UDP
};

typedef struct ST_NET_SERVER {
    QString             sIpAddr;
    int                 nPort;
    EUM_NET_PROTOCAL    eumProtocal;


    ST_NET_SERVER() {
        sIpAddr = "192.168.1.1";
        nPort = 8001;
    }
}NET_SERVER;

typedef struct ST_CFG_NETWORK {
    bool                b4G;
    bool                bStaticIP;
    bool                bUploadAuto;
    ST_NET_LOCAL        stNetLocal;
    ST_NET_SERVER       stNetServer;

    ST_CFG_NETWORK() {
        b4G = true;
        bStaticIP = false;
        bUploadAuto = false;
    }
}CFG_NETWORK;


#endif // GLOBAL_INI_H
